package com.yunji.app.base;

import com.yunji.aggregate.model.vo.analysis.StaffContainerVO;
import com.yunji.aggregate.model.vo.analysis.StaffTradeVO;
import com.yunji.aggregate.model.vo.analysis.StaffTradeDetailVO;
import com.yunji.aggregate.model.vo.analysis.StaffTradeEveryDayVO;
import com.yunji.aggregate.service.AnalysisService;
import com.yunji.common.base.BaseController;
import com.yunji.common.base.response.Response;
import com.yunji.common.base.response.ResponseHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @version 1.0
 * @Project: yunji-coffee
 * @Package com.yunji.app.user
 * @FileName GateWayStaffStatisticsController.java
 * @Copyright Copyright © 2024 云集互联. All Rights Reserved
 * Company		com
 * @CreateTime 2024-04-16 14:52:48
 * @Description 移动端-员工数据统计
 * @Modification Author                    History Time			Version				Description
 * --------------------------------------------------------------------------------
 * HuaAo				2024-04-16 14:52:48		1.0					1.0 Version
 * @since JDK 1.8.0_202
 */
@Api(tags = "移动端-数据统计模块")
@RestController
@RequestMapping("/gateway/staffStatistics")
public class GateWayStatisticsController extends BaseController {
    @Resource
    private AnalysisService analysis;

    /**
     * @Title getStaffTransactionData
     * @Desc 获取员工交易数据统计
     * @Date 2024-06-04 14:46:47.285
     * @Return ResponseStaffTradeData>
     */
    @GetMapping(value = "/StaffTransactionData")
    @ApiOperation("获取员工交易数据统计")
    public Response<StaffTradeVO> getStaffTransactionData() {
        return ResponseHelper.success(analysis.getStaffTransactionData());
    }

    /**
     * @Title getStaffContainerData
     * @Desc 获取员工货柜数据统计
     * @Date 2024-06-04 14:46:18.579
     * @Return ResponseStaffContainerData>
     */
    @GetMapping("/StaffContainerData")
    @ApiOperation("获取员工货柜数据统计")
    public Response<StaffContainerVO> getStaffContainerData() {
        return ResponseHelper.success(analysis.getStaffContainerData());
    }

    /**
     * @param month 月份
     * @Title getStaffTransactionDataMonth
     * @Desc 月度交易数据详情
     * @Date 2024-06-04 14:45:59.377
     * @Return ResponseStaffTradeDataDetail>
     */
    @GetMapping("/StaffTransactionDataMonth")
    @ApiOperation("月度交易数据详情")
    public Response<StaffTradeDetailVO> getStaffTransactionDataMonth(@RequestParam("month") String month) {
        return ResponseHelper.success(analysis.getStaffTransactionDataMonth(month));
    }

    /**
     * @Title getStaffContainerDataDetail
     * @Desc 货柜近几天交易笔数趋势
     * @Date 2024-06-04 14:45:40.979
     * @Return ResponseMap < String, List < StaffTradeEveryDay>>>
     */
    @GetMapping(value = "/StaffContainerDataDetail")
    @ApiOperation("货柜近几天交易笔数趋势")
    public Response<Map<String, List<StaffTradeEveryDayVO>>> getStaffContainerDataDetail() {
        return ResponseHelper.success(analysis.getStaffContainerDataDetail());
    }

}